
Doc Ref # IHD-OS-KBL-Vol 12-1.17
3. Try the DCO with each central frequency.
4. Select the divider and central frequency that gives the DCO with minimum deviation from DCO
central frequency and fits within the +1% and -6% requirement.
5. Find the P, Q, K values to create that divider.
Pseudo-code for HDMI and DVI DPLL Programming
Minimum Positive Deviation = 1%
Minimum Negative Deviation = 6%
Chosen Central Frequency = NONE
AFE Clock = 5 * Symbol Clock MHz
Even Candidate Dividers[] = { 4, 6, 8, 10, 12, 14, 16, 18, 20, 24, 28, 30, 32, 36, 40, 42,
44, 48, 52, 54, 56, 60, 64, 66, 68, 70, 72, 76, 78, 80, 84, 88, 90, 92, 96, 98 }
Odd Candidate Dividers[] = { 3, 5, 7, 9, 15, 21, 35 }
For each Divider Parity (Even, Odd) // Prefer even values for divider
If Divider Parity == Even
Candidate Dividers[] = Even Candidate Dividers[]
Else
Candidate Dividers[] = Odd Candidate Dividers[]
For each DCO Central Frequency // Try each central frequency
For each Candidate Dividers // Try each divider
DCO Frequency = Candidate Divider * AFE Clock
If DCO Frequency > DCO Central Frequency // Positive Deviation
DCO Central Frequency Deviation = 100 * (DCO Frequency - DCO Central Frequency)
/ DCO Central Frequency
If (DCO Central Frequency Deviation < Minimum Positive Deviation) // Check if it
meets the minimum requirement
Minimum Positive Deviation = DCO Central Frequency Deviation
Chosen Central Frequency = DCO Central Frequency
Chosen DCO Frequency = DCO Frequency
Chosen Divider = Candidate Divider
Else // Negative Deviation
DCO Central Frequency Deviation = 100 * ABS(DCO Frequency - DCO Central
Frequency) / DCO Central Frequency
If (DCO Central Frequency Deviation < Minimum Negative Deviation)
Minimum Negative Deviation = DCO Central Frequency Deviation
Chosen Central Frequency = DCO Central Frequency
Chosen DCO Frequency = DCO Frequency
Chosen Divider = Candidate Divider
Next Candidate Divider
Next DCO Central Frequency
If Chosen Central Frequency != NONE // Break out early if a good even divider is found
break
Next Divider Parity
getMultiplier(num)
{
if (num % 2 == 0) // Even
{
num1 = num / 2;
if (num1 == 1 || num1 == 2 || num1 == 3 || num1 == 5)
{
P0 = 2;
P1 = 1;
P2 = num1;
}
else if (num1 % 2 == 0) // Div by 4
{
P0 = 2;